var app = getApp();
Page( Object.assign({},{
    data:{
		siteroot : app.siteInfo.siteroot.replace('app/index.php', ''),uniacid: app.siteInfo.uniacid,
    },
    onLoad:function(options){
        var self = this;
        var type = options.type ? options.type : '';
        var id = options.id ? options.id : '';

        app.com.http('article','POST',{op:'info',type:type,id:id},30,false,'','',function(res){
            if (!res.data.errno && res.data) {
                self.setData({
                    content : res.data.data.content,
                    title : res.data.data.title,
                },function(){
                    self.setData({
                        inited : true,
                    });
                });

                if( res.data.data.content ){
                    var octoparse = require('../resource/wxParse/html2json2.js');
                    var transData = octoparse.parse(self.data.content);                   
                    self.setData({
                        nodes : transData,
                    })
                }

                wx.setNavigationBarTitle({
                    title: res.data.data.title
                });

            }else{
                app.com.alert(res.data.message,function(){
                    app.com.backPage(0);
                });
            }
        });

    },
    location : function( e ){
        app.com.location( e );
    },
    otherapp : function( e ){
        app.com.otherapp( e );
    },
    navigateto : function( e ){
        app.com.navigateto( e);
    },
    redirectto : function( e ){
        app.com.redirectto( e );
    },    
    callphone : function(e){
        app.com.callphone( e );
    },
    showimages : function( e ){
        app.com.showimages( e );
    },
    FormIdsubmit : function(e){

    },
    footNavigate(e){
        var url = e.currentTarget.dataset.url;
        wx.switchTab({
          url: url
        })
    },
    FormIdsubmit : function(e){
        if( app.globalData.formarr.length <= 20 ) app.globalData.formarr.push(e.detail.formId);
    },
    
}))